

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>管理操作 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="librgw (Python)" href="../api/" />
    <link rel="prev" title="Ruby Swift Examples" href="../swift/ruby/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../">Ceph 对象网关</a> &raquo;</li>
        
      <li>管理操作</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/radosgw/adminops.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 对象网关</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../frontends/">HTTP 前端</a></li>
<li class="toctree-l2"><a class="reference internal" href="../placement/">存储池归置与存储类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multisite/">多站配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multisite-sync-policy/">多站同步策略配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../pools/">存储池的配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../config-ref/">配置参考</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/">管理指南</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s3/">S3 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rgw-cache/">Data caching and CDN</a></li>
<li class="toctree-l2"><a class="reference internal" href="../swift/">Swift API</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">管理操作 API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#info">Info</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id6">查看使用率</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id7">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id8">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id9">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id10">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id11">裁剪使用率日志</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id12">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id13">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id14">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id15">查看用户信息</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id16">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id17">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id18">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id19">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id20">创建用户</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id21">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id22">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id23">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id24">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id25">修改用户信息</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id26">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id27">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id28">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id29">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id30">删除用户</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id31">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id32">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id33">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id34">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id35">创建子用户</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id36">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id37">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id38">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id39">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id40">修改子用户信息</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id41">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id42">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id43">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id44">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id45">删除子用户</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id46">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id47">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id48">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id49">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id50">创建密钥</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id51">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id52">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id53">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id54">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id55">删除密钥</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id56">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id57">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id58">特殊错误响应</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id59">响应内容解析</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id60">查看桶信息</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id61">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id62">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id63">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id64">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id65">检查桶索引</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id66">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id67">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id68">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id69">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id70">删除桶</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id71">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id72">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id73">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id74">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id75">解绑桶</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id76">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id77">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id78">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id79">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id80">链接桶</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id81">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id82">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id83">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id84">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id85">删除对象</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id86">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id87">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id88">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id89">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id90">查看桶或对象的策略</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id91">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id92">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id93">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id94">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id95">增加用户能力</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id96">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id97">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id98">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id99">特殊错误响应</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id100">请求实例</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id101">删除用户能力</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id102">语法</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id103">请求参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id104">响应内容解析</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id105">特殊错误响应</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id106">配额管理</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id107">查看用户配额</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id108">设置用户配额</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id109">查看桶配额</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id110">设置桶配额</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id111">设置个人桶的配额</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id112">限速</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id113">查看用户的限速策略</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id114">配置用户的限速策略</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id115">查看桶的限速策略</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id116">配置个人桶的限速策略</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id117">查看全局限速策略</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id118">配置全局用户限速策略</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id119">配置全局限速桶</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id120">配置全局的匿名用户限速策略</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id121">标准错误响应</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id122">绑定库</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../api/">Python 接口</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nfs/">通过 NFS 导出</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keystone/">与 OpenStack Keystone 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../barbican/">与 OpenStack Barbican 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../vault/">与 HashiCorp Vault 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../kmip/">KMIP Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../opa/">与 Open Policy Agent 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multitenancy/">多租户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../compression/">压缩</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ldap-auth/">LDAP 认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../encryption/">服务器端加密</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bucketpolicy/">桶策略</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dynamicresharding/">动态的桶索引重分片</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mfa/">多因子认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sync-modules/">同步模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../notifications/">Bucket Notifications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../layout/">RADOS 中的数据布局</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STS/">STS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STSLite/">STS Lite</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keycloak/">Keycloak</a></li>
<li class="toctree-l2"><a class="reference internal" href="../role/">Role</a></li>
<li class="toctree-l2"><a class="reference internal" href="../session-tags/">Session Tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orphans/">Orphan List and Associated Tooliing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../oidc/">OpenID Connect Provider</a></li>
<li class="toctree-l2"><a class="reference internal" href="../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw/">radosgw 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw-admin/">radosgw-admin 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../qat-accel/">使用 QAT 为加密和压缩提速</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s3select/">S3-select</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lua-scripting/">Lua Scripting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../d3n_datacache/">D3N Data Cache</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cloud-transition/">Cloud Transition</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="radosgw-admin-ops">
<span id="id1"></span><h1>管理操作<a class="headerlink" href="#radosgw-admin-ops" title="Permalink to this headline">¶</a></h1>
<p>管理 API 请求有专用的入口 URI ，是可配置的 ‘admin’ 入口。
管理 API 的授权与 S3 的授权机制相同。
有些操作需要用户拥有特殊的管理权限。
响应实体类型（ XML 或 JSON ）可以在请求中的 ‘format’ 选项指定，
如果没有指定，则默认为 JSON 。</p>
<div class="section" id="info">
<h2>Info<a class="headerlink" href="#info" title="Permalink to this headline">¶</a></h2>
<p>查看集群、终结点的信息。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>info=read</p>
</dd>
</dl>
<div class="section" id="id2">
<h3>语法<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/info?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h3>请求参数<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
<div class="section" id="id4">
<h3>响应内容解析<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
<p>如果成功，响应会包含一个 <code class="docutils literal notranslate"><span class="pre">info</span></code> 段。</p>
<p><code class="docutils literal notranslate"><span class="pre">info</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>所有返回信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">cluster_id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>RGW 集群的后端存储（一般是唯一的）标识符。
在典型案例中，这是 librados::rados::cluster_fsid()
返回的值。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">info</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id5">
<h3>特殊错误响应<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
</div>
<div class="section" id="id6">
<h2>查看使用率<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<p>请求带宽利用率信息。</p>
<p>注意：此功能默认是禁用的，可以在 ceph.conf 里的适当段落加上
<code class="docutils literal notranslate"><span class="pre">rgw</span> <span class="pre">enable</span> <span class="pre">usage</span> <span class="pre">log</span> <span class="pre">=</span> <span class="pre">true</span></code> 来启用，更改配置后需重启 radosgw 进程才能生效。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>usage=read</p>
</dd>
</dl>
<div class="section" id="id7">
<h3>语法<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/usage?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id8">
<h3>请求参数<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>请求哪个用户的信息，如果不指定就是所有用户的。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">start</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定所请求数据的起始时间的日期和（可选的）时间。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">2012-09-25</span> <span class="pre">16:00:00</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">end</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定所请求数据的截止时间的日期和（可选的）时间（不包含）。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">2012-09-25</span> <span class="pre">16:00:00</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">show-entries</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指示是否返回数据条目。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [True]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">show-summary</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指示是否返回数据汇总信息。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [True]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id9">
<h3>响应内容解析<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3>
<p>如果成功，响应会包含请求的信息。</p>
<p><code class="docutils literal notranslate"><span class="pre">usage</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>使用率信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">entries</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>使用率条目信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户数据信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">owner</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>这个桶的所有者的名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶的名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">time</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定数据的时间下限（四舍五入至起始的第一个小时）。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">epoch</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>从 1/1/1970 起的秒数。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">categories</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>统计类别的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">entry</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>统计条目的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">category</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>这些统计信息指向的请求类别的名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">bytes_sent</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>RADOS 网关发送的字节数。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">bytes_received</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>RADOS 网关接收到的字节数。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">ops</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>操作数量。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">successful_ops</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>成功操作的数量。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">summary</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>统计概要的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">total</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>汇总起来的统计概要的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
</div>
<div class="section" id="id10">
<h3>特殊错误响应<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
<p>TBD.</p>
</div>
</div>
<div class="section" id="id11">
<h2>裁剪使用率日志<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h2>
<p>删除使用率信息。若未指定日期，会删除所有使用率信息。</p>
<p>注意：此功能默认是禁用的，可以在 ceph.conf 里的适当段落加上
<code class="docutils literal notranslate"><span class="pre">rgw</span> <span class="pre">enable</span> <span class="pre">usage</span> <span class="pre">log</span> <span class="pre">=</span> <span class="pre">true</span></code> 来启用，更改配置后需重启
radosgw 进程才能生效。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>usage=write</p>
</dd>
</dl>
<div class="section" id="id12">
<h3>语法<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{admin}/usage?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id13">
<h3>请求参数<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>The user for which the information is requested. If not specified will apply to all users.</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">start</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>Date and (optional) time that specifies the start time of the requested data.</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">2012-09-25</span> <span class="pre">16:00:00</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">end</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>Date and (optional) time that specifies the end time of the requested data (none inclusive).</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">2012-09-25</span> <span class="pre">16:00:00</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">remove-all</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>uid 没指定时必需，为了确认多个用户数据的删除。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id14">
<h3>特殊错误响应<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3>
<p>TBD.</p>
</div>
</div>
<div class="section" id="id15">
<h2>查看用户信息<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h2>
<p>查看用户信息。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=read</p>
</dd>
</dl>
<div class="section" id="id16">
<h3>语法<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/user?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id17">
<h3>请求参数<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>The user for which the information is requested.</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
</div>
<div class="section" id="id18">
<h3>响应内容解析<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，这个响应会包含此用户的信息。</p>
<p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户数据信息的一个容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user_id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>此用户的标识符。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">display_name</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户对外显示的名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">suspended</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>如果此用户被暂停，其值为 True 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">max_buckets</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>这个用户最多可以拥有多少个桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户账户关联的子用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与这个用户账户关联的 S3 密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">swift_keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与这个用户账户关联的 Swift 密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id19">
<h3>特殊错误响应<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
</div>
<div class="section" id="id20">
<h2>创建用户<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h2>
<p>新建一个用户。默认情况下，会自动创建一个 S3 密钥对、并在响应时返回。
如果只提供了一个 <code class="docutils literal notranslate"><span class="pre">access-key</span></code> 或 <code class="docutils literal notranslate"><span class="pre">secret-key</span></code> ，
缺失的那个密钥会自动生成。
默认情况下，生成的密钥会加进密钥环，而非替换已有的密钥对；
如果指定了 <code class="docutils literal notranslate"><span class="pre">access-key</span></code> 且引用的是此用户已有的密钥，此时会修改这个密钥。</p>
<div class="versionadded">
<p><span class="versionmodified added">New in version Luminous.</span></p>
</div>
<p>指定租户 <code class="docutils literal notranslate"><span class="pre">tenant</span></code> 时，可以作为 uid 的一部分、或单独的请求参数。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id21">
<h3>语法<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{admin}/user?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id22">
<h3>请求参数<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要创建的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code> 可以带上租户名，遵守 <code class="docutils literal notranslate"><span class="pre">tenant$user</span></code> 语法就行，
详情请参考<a class="reference internal" href="../multitenancy/#rgw-multitenancy"><span class="std std-ref">多租户</span></a>。</p>
<p><code class="docutils literal notranslate"><span class="pre">display-name</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要创建用户的显示名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo</span> <span class="pre">user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">email</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户关联的 email 地址。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo&#64;bar.com</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">key-type</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要生成的密钥类型，可选的有 swift 、 s3 (默认的)。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">s3</span></code> [<code class="docutils literal notranslate"><span class="pre">s3</span></code>]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">access-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定访问密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">ABCD0EF12GHIJ2K34LMN</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">secret-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定私钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">0AbCDEFg1h2i34JklM5nop6QrSTUV+WxyzaBC7D8</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user-caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">usage=read,</span> <span class="pre">write;</span> <span class="pre">users=read</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">generate-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>生成一个新密钥对，并加进现有的密钥环。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [True]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">max-buckets</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>这个用户最多可以拥有多少个桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>500 [1000]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">suspended</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定是否挂起这个用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>False [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<div class="versionadded">
<p><span class="versionmodified added">New in version Jewel.</span></p>
</div>
<p><code class="docutils literal notranslate"><span class="pre">tenant</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户所属的租户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>string</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>tenant1</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id23">
<h3>响应内容解析<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，响应里包含用户信息。</p>
<p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户数据信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">tenant</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户所属的租户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user_id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>此用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">display_name</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>此用户的显示名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">suspended</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户被挂起时此值为 True 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">max_buckets</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>这个用户最多可以拥有多少个桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户账户关联的子用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户关联的 S3 密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">swift_keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户关联的 Swift 密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id24">
<h3>特殊错误响应<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">UserExists</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>试图创建已存在的用户。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidAccessKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定了无效的访问密钥。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidSecretKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定了无效的私钥。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidKeyType</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定了无效的密钥类型。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">KeyExists</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>提供的访问密钥已存在，但是它属于另外一个用户。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">EmailExists</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>提供的邮件地址已存在。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidCapability</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>试图赋予无效的管理员能力。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id25">
<h2>修改用户信息<a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h2>
<p>更改一个用户的信息。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id26">
<h3>语法<a class="headerlink" href="#id26" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/user?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id27">
<h3>请求参数<a class="headerlink" href="#id27" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要更改的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">display-name</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要更改的用户的显示名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo</span> <span class="pre">user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">email</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要与此用户关联的 email 地址。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo&#64;bar.com</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">generate-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>生成一个新密钥对，并加进现有的密钥环。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">access-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定访问密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">ABCD0EF12GHIJ2K34LMN</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">secret-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定私钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">0AbCDEFg1h2i34JklM5nop6QrSTUV+WxyzaBC7D8</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">key-type</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要生成的密钥类型，可选的有 swift 、 s3 (默认值)。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">s3</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">max-buckets</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>这个用户最多可以拥有多少个桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>500 [1000]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">suspended</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>是否挂起此用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>False [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">op-mask</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要更改的用户的掩码（ op-mask ）。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">read,</span> <span class="pre">write,</span> <span class="pre">delete,</span> <span class="pre">*</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id28">
<h3>响应内容解析<a class="headerlink" href="#id28" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，响应会包含请求的信息。</p>
<p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户数据信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user_id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">display_name</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>此用户的显示名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">suspended</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>如果此用户被暂停，此值是 True。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">max_buckets</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>这个用户最多可以拥有多少个桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Integer</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户账户关联的子用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户关联的 S3 密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">swift_keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户关联的 Swift 密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id29">
<h3>特殊错误响应<a class="headerlink" href="#id29" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">InvalidAccessKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定了无效的访问密钥。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidKeyType</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定了无效的密钥类型。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidSecretKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定了无效的私钥。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">KeyExists</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>提供的访问密钥已存在，但是它属于另外一个用户。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">EmailExists</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>提供的邮件地址已存在。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidCapability</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>试图赋予无效的管理员能力。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id30">
<h2>删除用户<a class="headerlink" href="#id30" title="Permalink to this headline">¶</a></h2>
<p>删除一个现有用户。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id31">
<h3>语法<a class="headerlink" href="#id31" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{admin}/user?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id32">
<h3>请求参数<a class="headerlink" href="#id32" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes.</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">purge-data</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定后，属于此用户的桶和对象也会被删除。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id33">
<h3>响应内容解析<a class="headerlink" href="#id33" title="Permalink to this headline">¶</a></h3>
<p>None</p>
</div>
<div class="section" id="id34">
<h3>特殊错误响应<a class="headerlink" href="#id34" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
</div>
<div class="section" id="id35">
<h2>创建子用户<a class="headerlink" href="#id35" title="Permalink to this headline">¶</a></h2>
<p>新建一个子用户（使用 Swift API 的客户端需要）。
提醒一下，要创建可正常使用的子用户，
必须用 <code class="docutils literal notranslate"><span class="pre">access</span></code> 授予权限；创建子用户时，
如果没给 <code class="docutils literal notranslate"><span class="pre">subuser</span></code> 指定密钥 <code class="docutils literal notranslate"><span class="pre">secret</span></code> ，会自动生成一个。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id36">
<h3>语法<a class="headerlink" href="#id36" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{admin}/user?subuser&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id37">
<h3>请求参数<a class="headerlink" href="#id37" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>子用户在哪个用户 ID 下创建。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subuser</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定要创建的子用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">sub_foo</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">secret-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">0AbCDEFg1h2i34JklM5nop6QrSTUV+WxyzaBC7D8</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">key-type</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要生成的密钥类型，可选的有 swift (默认值)、 s3 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">swift</span></code> [<code class="docutils literal notranslate"><span class="pre">swift</span></code>]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">access</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>设置子用户的访问权限，应该是 <code class="docutils literal notranslate"><span class="pre">read,</span> <span class="pre">write,</span> <span class="pre">readwrite,</span> <span class="pre">full</span></code> 其中之一。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">read</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">generate-secret</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>生成密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id38">
<h3>响应内容解析<a class="headerlink" href="#id38" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，响应里包含子用户信息。</p>
<p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户账户关联的子用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>子用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">permissions</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>子用户访问用户账户的权限。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id39">
<h3>特殊错误响应<a class="headerlink" href="#id39" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">SubuserExists</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的子用户已存在。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidKeyType</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的密钥类型无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidSecretKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的私钥无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidAccess</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的子用户权限无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id40">
<h2>修改子用户信息<a class="headerlink" href="#id40" title="Permalink to this headline">¶</a></h2>
<p>更改现有的子用户。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id41">
<h3>语法<a class="headerlink" href="#id41" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/user?subuser&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id42">
<h3>请求参数<a class="headerlink" href="#id42" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要修改的子用户所属的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subuser</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要更改的子用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">sub_foo</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">generate-secret</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>给这个子用户生成一个新的私钥，来替换现有密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">secret</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定私钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">0AbCDEFg1h2i34JklM5nop6QrSTUV+WxyzaBC7D8</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">key-type</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要生成的密钥类型，可选的有 swift （默认值）、 s3 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">swift</span></code> [<code class="docutils literal notranslate"><span class="pre">swift</span></code>]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">access</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>设置子用户的访问权限，应该是 <code class="docutils literal notranslate"><span class="pre">read,</span> <span class="pre">write,</span> <span class="pre">readwrite,</span> <span class="pre">full</span></code> 里面的。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">read</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id43">
<h3>响应内容解析<a class="headerlink" href="#id43" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，响应里包含子用户信息。</p>
<p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户账户关联的子用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>子用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">permissions</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>子用户对用户账户的访问权限。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">subusers</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id44">
<h3>特殊错误响应<a class="headerlink" href="#id44" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">InvalidKeyType</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的密钥类型无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidSecretKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的私钥无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidAccess</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的子用户权限无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id45">
<h2>删除子用户<a class="headerlink" href="#id45" title="Permalink to this headline">¶</a></h2>
<p>删除一个现有子用户。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id46">
<h3>语法<a class="headerlink" href="#id46" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{admin}/user?subuser&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id47">
<h3>请求参数<a class="headerlink" href="#id47" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除子用户所属的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subuser</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除的子用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">sub_foo</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">purge-keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>删除子用户的密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [True]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id48">
<h3>响应内容解析<a class="headerlink" href="#id48" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
<div class="section" id="id49">
<h3>特殊错误响应<a class="headerlink" href="#id49" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
</div>
<div class="section" id="id50">
<h2>创建密钥<a class="headerlink" href="#id50" title="Permalink to this headline">¶</a></h2>
<p>创建一个新密钥。如果指定了 <code class="docutils literal notranslate"><span class="pre">subuser</span></code> ，默认会创建 swift 类型的密钥。
如果只指定了 <code class="docutils literal notranslate"><span class="pre">access-key</span></code> 或 <code class="docutils literal notranslate"><span class="pre">secret-key</span></code> 其中之一，
另一个密钥也会自动生成，也就是说，如果只指定了 <code class="docutils literal notranslate"><span class="pre">secret-key</span></code> ，
那么 <code class="docutils literal notranslate"><span class="pre">access-key</span></code> 会自动生成。默认情况下，
生成的密钥会被加进密钥环，而不是替换已经存在的密钥对。
如果指定的是 <code class="docutils literal notranslate"><span class="pre">access-key</span></code> ，且引用的是这个用户已经存在的密钥，
就会修改它。响应结果是一个容器，罗列了和刚创建密钥同一类型的所有密钥。
注意，创建 swift 密钥时，指定 <code class="docutils literal notranslate"><span class="pre">access-key</span></code> 选项无效；
另外，每个用户或子用户只能持有一个 swift 密钥。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id51">
<h3>语法<a class="headerlink" href="#id51" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{admin}/user?key&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id52">
<h3>请求参数<a class="headerlink" href="#id52" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>接收新密钥的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subuser</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>接收新密钥的子用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">sub_foo</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">key-type</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要生成的密钥类型，可选的有 swift 、 s3 （默认值）。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">s3</span></code> [<code class="docutils literal notranslate"><span class="pre">s3</span></code>]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">access-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定访问密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">AB01C2D3EF45G6H7IJ8K</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">secret-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定私钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">0ab/CdeFGhij1klmnopqRSTUv1WxyZabcDEFgHij</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">generate-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>生成一个新的密钥对，并加进现有的密钥环。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [<code class="docutils literal notranslate"><span class="pre">True</span></code>]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id53">
<h3>响应内容解析<a class="headerlink" href="#id53" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>与此用户账户关联的、创建的密钥类型。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>和密钥关联的用户账户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">access-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>访问密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">secret-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id54">
<h3>特殊错误响应<a class="headerlink" href="#id54" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">InvalidAccessKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的访问密钥无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidSecretKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的私钥无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InvalidKeyType</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的密钥类型无效。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">KeyExists</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>提供的访问密钥存在，但是它属于另外一个用户。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id55">
<h2>删除密钥<a class="headerlink" href="#id55" title="Permalink to this headline">¶</a></h2>
<p>删除一个存在的密钥。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id56">
<h3>语法<a class="headerlink" href="#id56" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{admin}/user?key&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id57">
<h3>请求参数<a class="headerlink" href="#id57" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">access-key</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除的 S3 密钥对里的访问密钥。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">AB01C2D3EF45G6H7IJ8K</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除密钥的用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">subuser</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除密钥的子用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">sub_foo</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">key-type</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除的密钥类型，可选的有 swift 、 s3 。
注意：删除 swift 密钥时必须提供。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">swift</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id58">
<h3>特殊错误响应<a class="headerlink" href="#id58" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
<div class="section" id="id59">
<h3>响应内容解析<a class="headerlink" href="#id59" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
</div>
<div class="section" id="id60">
<h2>查看桶信息<a class="headerlink" href="#id60" title="Permalink to this headline">¶</a></h2>
<p>获取一部分已有桶的相关信息。如果指定了 <code class="docutils literal notranslate"><span class="pre">uid</span></code> 却没有 <code class="docutils literal notranslate"><span class="pre">bucket</span></code> ，
就会得到属于此用户的所有桶；如果还指定了 <code class="docutils literal notranslate"><span class="pre">bucket</span></code> ，
就只去检索那一个桶的信息。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>buckets=read</p>
</dd>
</dl>
<div class="section" id="id61">
<h3>语法<a class="headerlink" href="#id61" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/bucket?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id62">
<h3>请求参数<a class="headerlink" href="#id62" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>返回信息的桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_bucket</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>为哪个用户检索桶信息。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">stats</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>返回桶的统计信息。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id63">
<h3>响应内容解析<a class="headerlink" href="#id63" title="Permalink to this headline">¶</a></h3>
<p>如果成功，这个请求会返回一个桶容器，
包含着想要的桶信息。</p>
<p><code class="docutils literal notranslate"><span class="pre">stats</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>单个桶的信息 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">buckets</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>包含一个或多个桶容器的列表。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>单个桶的信息容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">buckets</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">name</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶的名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">pool</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶所在的存储池。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>唯一的桶 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">marker</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>内部的桶标签。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">owner</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶所有者的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">usage</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>存储使用率信息。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">index</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶索引的状态。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id64">
<h3>特殊错误响应<a class="headerlink" href="#id64" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">IndexRepairFailed</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶索引修复失败了。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id65">
<h2>检查桶索引<a class="headerlink" href="#id65" title="Permalink to this headline">¶</a></h2>
<p>检查一个现有桶的索引。注意，要检查多块对象的记帐信息需要加 <code class="docutils literal notranslate"><span class="pre">check-objects</span></code> ， <code class="docutils literal notranslate"><span class="pre">fix</span></code> 必须设置为 True 。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>buckets=write</p>
</dd>
</dl>
<div class="section" id="id66">
<h3>语法<a class="headerlink" href="#id66" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/bucket?index&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id67">
<h3>请求参数<a class="headerlink" href="#id67" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>返回信息的桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_bucket</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">check-objects</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>检查分块对象的记账信息。</p>
</dd>
<dt class="field-even">实例</dt>
<dd class="field-even"><p>True [False]</p>
</dd>
<dt class="field-odd">是否必需</dt>
<dd class="field-odd"><p>No</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">fix</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>检查时顺便修复桶索引。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>False [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id68">
<h3>响应内容解析<a class="headerlink" href="#id68" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">index</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶索引的状态。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
</dl>
</div>
<div class="section" id="id69">
<h3>特殊错误响应<a class="headerlink" href="#id69" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">IndexRepairFailed</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶索引修复失败了。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id70">
<h2>删除桶<a class="headerlink" href="#id70" title="Permalink to this headline">¶</a></h2>
<p>删除一个存在的桶。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>buckets=write</p>
</dd>
</dl>
<div class="section" id="id71">
<h3>语法<a class="headerlink" href="#id71" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{admin}/bucket?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id72">
<h3>请求参数<a class="headerlink" href="#id72" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除的桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_bucket</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">purge-objects</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>删除桶前先删光里面的对象。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Boolean</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p>True [False]</p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id73">
<h3>响应内容解析<a class="headerlink" href="#id73" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
<div class="section" id="id74">
<h3>特殊错误响应<a class="headerlink" href="#id74" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">BucketNotEmpty</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>试图删除非空的桶。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">ObjectRemovalFailed</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>无法删除对象。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id75">
<h2>解绑桶<a class="headerlink" href="#id75" title="Permalink to this headline">¶</a></h2>
<p>解绑桶和用户，主要用于更改桶的所有者。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>buckets=write</p>
</dd>
</dl>
<div class="section" id="id76">
<h3>语法<a class="headerlink" href="#id76" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/bucket?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id77">
<h3>请求参数<a class="headerlink" href="#id77" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要解除连接的桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_bucket</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要断开桶与哪个用户 ID 的连接。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
</div>
<div class="section" id="id78">
<h3>响应内容解析<a class="headerlink" href="#id78" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
<div class="section" id="id79">
<h3>特殊错误响应<a class="headerlink" href="#id79" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">BucketUnlinkFailed</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>不能断开桶与指定用户的链接。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id80">
<h2>链接桶<a class="headerlink" href="#id80" title="Permalink to this headline">¶</a></h2>
<p>把桶链接到指定用户，同时断开与之前用户的链接。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>buckets=write</p>
</dd>
</dl>
<div class="section" id="id81">
<h3>语法<a class="headerlink" href="#id81" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{admin}/bucket?format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id82">
<h3>请求参数<a class="headerlink" href="#id82" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要切断链接的桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_bucket</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">bucket-id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要切断链接的桶 id 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">示例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">dev.6607669.420</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户的 ID ，桶会被链接到此用户。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
</div>
<div class="section" id="id83">
<h3>响应内容解析<a class="headerlink" href="#id83" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>单个桶的信息容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">name</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶的名字。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">pool</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶所在的存储池。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>唯一的桶 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">marker</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>内部的桶标签。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">owner</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶所有者的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">usage</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>存储使用率信息。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">index</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶索引的状态。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id84">
<h3>特殊错误响应<a class="headerlink" href="#id84" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">BucketUnlinkFailed</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>不能断开桶到用户的链接，</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">BucketLinkFailed</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>不能把桶链接到指定的用户。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id85">
<h2>删除对象<a class="headerlink" href="#id85" title="Permalink to this headline">¶</a></h2>
<p>删除一个存在的对象。注意：不要求所有者是没被暂停的。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>buckets=write</p>
</dd>
</dl>
<div class="section" id="id86">
<h3>语法<a class="headerlink" href="#id86" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{admin}/bucket?object&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id87">
<h3>请求参数<a class="headerlink" href="#id87" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除的对象所在的桶。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_bucket</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除的对象。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo.txt</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
</div>
<div class="section" id="id88">
<h3>响应内容解析<a class="headerlink" href="#id88" title="Permalink to this headline">¶</a></h3>
<p>None.</p>
</div>
<div class="section" id="id89">
<h3>特殊错误响应<a class="headerlink" href="#id89" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">NoSuchObject</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>指定的对象不存在。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>404 Not Found</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">ObjectRemovalFailed</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>无法删除对象。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>409 Conflict</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id90">
<h2>查看桶或对象的策略<a class="headerlink" href="#id90" title="Permalink to this headline">¶</a></h2>
<p>读取一个对象或桶的策略。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>buckets=read</p>
</dd>
</dl>
<div class="section" id="id91">
<h3>语法<a class="headerlink" href="#id91" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/bucket?policy&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id92">
<h3>请求参数<a class="headerlink" href="#id92" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">bucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>从哪个桶读取策略。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_bucket</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>从哪个对象读取策略。</p>
</dd>
<dt class="field-even">实例</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">foo.txt</span></code></p>
</dd>
<dt class="field-odd">是否必需</dt>
<dd class="field-odd"><p>No</p>
</dd>
</dl>
</div>
<div class="section" id="id93">
<h3>响应内容解析<a class="headerlink" href="#id93" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，返回此对象或桶的策略。</p>
<p><code class="docutils literal notranslate"><span class="pre">policy</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>访问控制策略。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
</dl>
</div>
<div class="section" id="id94">
<h3>特殊错误响应<a class="headerlink" href="#id94" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">IncompleteBody</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶策略请求中没有指定桶，或者对象策略请求中没有指定桶和对象。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id95">
<h2>增加用户能力<a class="headerlink" href="#id95" title="Permalink to this headline">¶</a></h2>
<p>给指定用户增加管理能力。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id96">
<h3>语法<a class="headerlink" href="#id96" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{admin}/user?caps&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id97">
<h3>请求参数<a class="headerlink" href="#id97" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要给增加管理能力的用户 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user-caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>给用户增加的管理能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">usage=read,write;user=write</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
</div>
<div class="section" id="id98">
<h3>响应内容解析<a class="headerlink" href="#id98" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，响应里包含用户的能力。</p>
<p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户数据信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user_id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>此用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户的能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id99">
<h3>特殊错误响应<a class="headerlink" href="#id99" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">InvalidCapability</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>试图授予无效的管理能力。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
</div>
<div class="section" id="id100">
<h3>请求实例<a class="headerlink" href="#id100" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{admin}/user?caps&amp;user-caps=usage=read,write;user=write&amp;format=json HTTP/1.1
Host: {fqdn}
Content-类型: text/plain
Authorization: {your-authorization-token}
</pre></div>
</div>
</div>
</div>
<div class="section" id="id101">
<h2>删除用户能力<a class="headerlink" href="#id101" title="Permalink to this headline">¶</a></h2>
<p>删除指定用户的管理能力。</p>
<dl class="field-list simple">
<dt class="field-odd">caps</dt>
<dd class="field-odd"><p>users=write</p>
</dd>
</dl>
<div class="section" id="id102">
<h3>语法<a class="headerlink" href="#id102" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{admin}/user?caps&amp;format=json HTTP/1.1
Host: {fqdn}
</pre></div>
</div>
</div>
<div class="section" id="id103">
<h3>请求参数<a class="headerlink" href="#id103" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">uid</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要删除这个用户 ID 的管理能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">foo_user</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user-caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>要为此用户删除的管理能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">实例</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">usage=read,</span> <span class="pre">write</span></code></p>
</dd>
<dt class="field-even">是否必需</dt>
<dd class="field-even"><p>Yes</p>
</dd>
</dl>
</div>
<div class="section" id="id104">
<h3>响应内容解析<a class="headerlink" href="#id104" title="Permalink to this headline">¶</a></h3>
<p>如果成功了，响应里包含用户的能力。</p>
<p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户数据信息的容器。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">user_id</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>此用户的 ID 。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">caps</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户的能力。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>Container</p>
</dd>
<dt class="field-odd">父节点</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p>
</dd>
</dl>
</div>
<div class="section" id="id105">
<h3>特殊错误响应<a class="headerlink" href="#id105" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">InvalidCapability</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>试图删除一个无效的管理员能力。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>400 Bad Request</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">NoSuchCap</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户没有指定的能力。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>404 Not Found</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id106">
<h2>配额管理<a class="headerlink" href="#id106" title="Permalink to this headline">¶</a></h2>
<p>你可以用管理操作 API 给用户和用户拥有的桶设置配额，设置细节见<a class="reference external" href="../admin#quota-management">配额管理</a>。可设置的配额包括桶内对象的最大数量、和最大尺寸（单位为 MB ）。</p>
<p>要查看配额信息，用户必须有 <code class="docutils literal notranslate"><span class="pre">users=read</span></code> 能力；
要设置、修改或禁用配额，用户必须有 <code class="docutils literal notranslate"><span class="pre">users=write</span></code> 能力。
详情见<a class="reference external" href="../admin">管理指南</a>。</p>
<p>管理配额的可用参数有：</p>
<ul class="simple">
<li><p><strong>桶：</strong> <code class="docutils literal notranslate"><span class="pre">bucket</span></code> 选项指定了配额针对的是用户拥有的桶。</p></li>
<li><p><strong>最大对象数：</strong> <code class="docutils literal notranslate"><span class="pre">max-objects</span></code> 选项用于指定最大对象数，
负数表示禁用此选项。</p></li>
<li><p><strong>最大尺寸</strong> <code class="docutils literal notranslate"><span class="pre">max-size</span></code> 选项用于指定最大字节数，
<code class="docutils literal notranslate"><span class="pre">max-size-kb</span></code> 选项指定的以 KiB 为单位。
负数表示禁用此选项。</p></li>
<li><p><strong>配额类型：</strong> <code class="docutils literal notranslate"><span class="pre">quota-type</span></code> 选项用于指定配额的适用范围，
可以是 <code class="docutils literal notranslate"><span class="pre">bucket</span></code> 和 <code class="docutils literal notranslate"><span class="pre">user</span></code> 。</p></li>
<li><p><strong>配额开关：</strong> <code class="docutils literal notranslate"><span class="pre">enabled</span></code> 选项用于配置是否开启配额，
取值可以是 ‘True’ 或 ‘False’ 。</p></li>
</ul>
<div class="section" id="id107">
<h3>查看用户配额<a class="headerlink" href="#id107" title="Permalink to this headline">¶</a></h3>
<p>要查看配额信息，此用户必须有 <code class="docutils literal notranslate"><span class="pre">users</span></code> 能力的 <code class="docutils literal notranslate"><span class="pre">read</span></code> 权限。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /admin/user?quota&amp;uid=&lt;uid&gt;&amp;quota-type=user
</pre></div>
</div>
</div>
<div class="section" id="id108">
<h3>设置用户配额<a class="headerlink" href="#id108" title="Permalink to this headline">¶</a></h3>
<p>要设置配额，此用户必须有 <code class="docutils literal notranslate"><span class="pre">users</span></code> 能力的 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /admin/user?quota&amp;uid=&lt;uid&gt;&amp;quota-type=user
</pre></div>
</div>
<p>内容必须包含一个 JSON 格式的配额设置信息，
编码应该和读操作对应。</p>
</div>
<div class="section" id="id109">
<h3>查看桶配额<a class="headerlink" href="#id109" title="Permalink to this headline">¶</a></h3>
<p>要查看配额信息，此用户必须有 <code class="docutils literal notranslate"><span class="pre">users</span></code> 能力的 <code class="docutils literal notranslate"><span class="pre">read</span></code> 权限。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /admin/user?quota&amp;uid=&lt;uid&gt;&amp;quota-type=bucket
</pre></div>
</div>
</div>
<div class="section" id="id110">
<h3>设置桶配额<a class="headerlink" href="#id110" title="Permalink to this headline">¶</a></h3>
<p>要设置配额，此用户必须有 <code class="docutils literal notranslate"><span class="pre">users</span></code> 能力的 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /admin/user?quota&amp;uid=&lt;uid&gt;&amp;quota-type=bucket
</pre></div>
</div>
<p>内容必须包含一个 JSON 格式的配额设置信息，
编码应该和读操作对应。</p>
</div>
<div class="section" id="id111">
<h3>设置个人桶的配额<a class="headerlink" href="#id111" title="Permalink to this headline">¶</a></h3>
<p>要设置配额，此用户必须有设置了 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限的
<code class="docutils literal notranslate"><span class="pre">buckets</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /admin/bucket?quota&amp;uid=&lt;uid&gt;&amp;bucket=&lt;bucket-name&gt;
</pre></div>
</div>
<p>其内容必须包含一个以 JSON 格式表达的配额配置，如前面<a class="reference internal" href="#id110">设置桶配额</a>一节所述。</p>
</div>
</div>
<div class="section" id="id112">
<h2>限速<a class="headerlink" href="#id112" title="Permalink to this headline">¶</a></h2>
<p>管理操作接口（ Admin Operations API ）可以用来配置和查看用户、桶、和全局的限速策略配置情况。更多信息见 <a class="reference external" href="../admin#rate-limit-management">限速管理</a> 。
对速度的限制包括操作的最大数量、和/或每分钟的字节数、 MB 表示的最大存储尺寸，
读和/或写是分别控制的，针对桶和/或单个用户。</p>
<p>要查看限速配置，用户必须有 <code class="docutils literal notranslate"><span class="pre">ratelimit=read</span></code> 能力。
要配置、修改或禁用限速策略，用户必须有 <code class="docutils literal notranslate"><span class="pre">ratelimit=write</span></code> 能力。
详情见 <a class="reference external" href="../admin">管理指南</a> 。</p>
<p>限速配置可用的参数有：</p>
<ul class="simple">
<li><p><strong>桶:</strong> <code class="docutils literal notranslate"><span class="pre">bucket</span></code> 选项表示给桶指定限速策略。</p></li>
<li><p><strong>用户:</strong> <code class="docutils literal notranslate"><span class="pre">uid</span></code> 选项表示给用户指定限速策略。</p></li>
<li><p><strong>最大读字节数:</strong> <code class="docutils literal notranslate"><span class="pre">max-read-bytes</span></code> 选项指定每分钟读取的最大字节数。
数值为 0 表示禁用此选项。</p></li>
<li><p><strong>最大写字节数:</strong> <code class="docutils literal notranslate"><span class="pre">max-write-bytes</span></code> 选项指定每分钟写入的最大字节数。
数值为 0 表示禁用此选项。</p></li>
<li><p><strong>最大读操作数:</strong> <code class="docutils literal notranslate"><span class="pre">max-read-ops</span></code> 选项指定每分钟最大的读取操作数量。
数值为 0 表示禁用此选项。</p></li>
<li><p><strong>最大写操作数:</strong> <code class="docutils literal notranslate"><span class="pre">max-write-ops</span></code> 选项指定每分钟最大的写入操作数量。
数值为 0 表示禁用此选项。</p></li>
<li><p><strong>全局:</strong> <code class="docutils literal notranslate"><span class="pre">global</span></code> 选项表示指定的是全局限速策略。
它的值应该是 True 或 False 。</p></li>
<li><p><strong>限速范围:</strong> <code class="docutils literal notranslate"><span class="pre">ratelimit-scope</span></code> 选项设置了限速的范围。
可选的值有 <code class="docutils literal notranslate"><span class="pre">bucket</span></code> 、 <code class="docutils literal notranslate"><span class="pre">user</span></code> 和 <code class="docutils literal notranslate"><span class="pre">anonymous</span></code> 。
<code class="docutils literal notranslate"><span class="pre">anonymous</span></code> 仅适用于全局配置时。</p></li>
<li><p><strong>启用、禁用限速:</strong> <code class="docutils literal notranslate"><span class="pre">enabled</span></code> 选项指定是否启用限速功能。
它的值应该是 True 或 False 。</p></li>
</ul>
<div class="section" id="id113">
<h3>查看用户的限速策略<a class="headerlink" href="#id113" title="Permalink to this headline">¶</a></h3>
<p>要查看限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">read</span></code> 权限的 <code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/ratelimit?ratelimit-scope=user&amp;uid=&lt;uid&gt;
</pre></div>
</div>
</div>
<div class="section" id="id114">
<h3>配置用户的限速策略<a class="headerlink" href="#id114" title="Permalink to this headline">¶</a></h3>
<p>要配置限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限的 <code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/ratelimit?ratelimit-scope=user&amp;uid=&lt;uid&gt;&lt;[&amp;max-read-bytes=&lt;bytes&gt;][&amp;max-write-bytes=&lt;bytes&gt;][&amp;max-read-ops=&lt;ops&gt;][&amp;max-write-ops=&lt;ops&gt;][enabled=&lt;True|False&gt;]&gt;
</pre></div>
</div>
</div>
<div class="section" id="id115">
<h3>查看桶的限速策略<a class="headerlink" href="#id115" title="Permalink to this headline">¶</a></h3>
<p>要查看限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">read</span></code> 权限的 <code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/ratelimit?bucket=&lt;bucket&gt;&amp;ratelimit-scope=bucket
</pre></div>
</div>
</div>
<div class="section" id="id116">
<h3>配置个人桶的限速策略<a class="headerlink" href="#id116" title="Permalink to this headline">¶</a></h3>
<p>要配置限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限的 <code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/ratelimit?bucket=&lt;bucket-name&gt;&amp;ratelimit-scope=bucket&lt;[&amp;max-read-bytes=&lt;bytes&gt;][&amp;max-write-bytes=&lt;bytes&gt;][&amp;max-read-ops=&lt;ops&gt;][&amp;max-write-ops=&lt;ops&gt;]&gt;
</pre></div>
</div>
</div>
<div class="section" id="id117">
<h3>查看全局限速策略<a class="headerlink" href="#id117" title="Permalink to this headline">¶</a></h3>
<p>要查看全局限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">read</span></code> 权限的 <code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{admin}/ratelimit?global=&lt;True|False&gt;
</pre></div>
</div>
</div>
<div class="section" id="id118">
<h3>配置全局用户限速策略<a class="headerlink" href="#id118" title="Permalink to this headline">¶</a></h3>
<p>要配置限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限的
<code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/ratelimit?ratelimit-scope=user&amp;global=&lt;True|False&gt;&lt;[&amp;max-read-bytes=&lt;bytes&gt;][&amp;max-write-bytes=&lt;bytes&gt;][&amp;max-read-ops=&lt;ops&gt;][&amp;max-write-ops=&lt;ops&gt;][enabled=&lt;True|False&gt;]&gt;
</pre></div>
</div>
</div>
<div class="section" id="id119">
<h3>配置全局限速桶<a class="headerlink" href="#id119" title="Permalink to this headline">¶</a></h3>
<p>要配置限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限的
<code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/ratelimit?ratelimit-scope=bucket&amp;global=&lt;True|False&gt;&lt;[&amp;max-read-bytes=&lt;bytes&gt;][&amp;max-write-bytes=&lt;bytes&gt;][&amp;max-read-ops=&lt;ops&gt;][&amp;max-write-ops=&lt;ops&gt;]&gt;
</pre></div>
</div>
</div>
<div class="section" id="id120">
<h3>配置全局的匿名用户限速策略<a class="headerlink" href="#id120" title="Permalink to this headline">¶</a></h3>
<p>要配置限速，这个用户必须有设置为 <code class="docutils literal notranslate"><span class="pre">write</span></code> 权限的
<code class="docutils literal notranslate"><span class="pre">ratelimit</span></code> 能力。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{admin}/ratelimit?ratelimit-scope=anon&amp;global=&lt;True|False&gt;&lt;[&amp;max-read-bytes=&lt;bytes&gt;][&amp;max-write-bytes=&lt;bytes&gt;][&amp;max-read-ops=&lt;ops&gt;][&amp;max-write-ops=&lt;ops&gt;][enabled=&lt;True|False&gt;]&gt;
</pre></div>
</div>
</div>
</div>
<div class="section" id="id121">
<h2>标准错误响应<a class="headerlink" href="#id121" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">AccessDenied</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>访问被拒绝。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>403 Forbidden</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">InternalError</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>服务器内部错误。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>500 Internal Server Error</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">NoSuchUser</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>用户不存在。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>404 Not Found</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">NoSuchBucket</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>桶不存在。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>404 Not Found</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">NoSuchKey</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>此访问密钥不存在。</p>
</dd>
<dt class="field-even">状态码</dt>
<dd class="field-even"><p>404 Not Found</p>
</dd>
</dl>
</div>
<div class="section" id="id122">
<h2>绑定库<a class="headerlink" href="#id122" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">Golang</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="https://github.com/IrekFasikhov/go-rgwadmin">IrekFasikhov/go-rgwadmin</a></p></li>
<li><p><a class="reference external" href="https://github.com/QuentinPerez/go-radosgw">QuentinPerez/go-radosgw</a></p></li>
</ul>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">Java</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="https://github.com/twonote/radosgw-admin4j">twonote/radosgw-admin4j</a></p></li>
</ul>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">Python</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="https://github.com/UMIACS/rgwadmin">UMIACS/rgwadmin</a></p></li>
<li><p><a class="reference external" href="https://github.com/valerytschopp/python-radosgw-admin">valerytschopp/python-radosgw-admin</a></p></li>
</ul>
</div></blockquote>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../api/" class="btn btn-neutral float-right" title="librgw (Python)" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../swift/ruby/" class="btn btn-neutral float-left" title="Ruby Swift Examples" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>